#ifndef __UPDATE_APP_FUNC_H_
#define __UPDATE_APP_FUNC_H_

#include "Global.h"

#define BUF_SIZE          	512//60//600//10//   

#define GET_CHAR_TIME_OUT	1000//20

#define PC_CMD_ERR_HEAD            1
#define PC_CMD_ERR_WRITE_INDEX     2
#define PC_CMD_ERR_TIMEOUT         3
#define PC_CMD_ERR_CRC32           4


#define PUDATE_COMX_BOUND           115200

typedef void (*pTxfunc)(uint8 data);
typedef void (*pConfig)(uint32 bound);

typedef struct
{
	unsigned short write_index;
	unsigned char  buf[BUF_SIZE];
	unsigned char  get_char_state;                 	//��׽ָ������״̬
    unsigned char  get_char_finish;                	//ָ�׽���
    unsigned char  get_char_err_type;               //��������
    unsigned char  flg_get_char_statr;            	//ָ���ȡ��ʼ
    unsigned long  get_char_timeout_cnt;            //��ȡָ�ʱ�ۼ�
    pTxfunc pSendByteFunc;
    pConfig pHardwareConfig;
}UART_PRMT_TYPEDEF;

extern UART_PRMT_TYPEDEF update_port_prmt;

void update_app_init(void);
void update_app_put_char(unsigned char *pdata,unsigned short len);
void update_app_irq_handler(unsigned char data);
void get_char_timeout_func(void);


#endif



